//回调写法
function hell(win){
	//  for listener purpose
	return async function(){
		loadLink(win, REMOTE_SRC + "/assets/css/style.css", function () {
			loadLink(win, REMOTE_SRC + "/lib/async.js", function () {
				loadLink(win, REMOTE_SRC + "/lib/json2.js", function () {
					loadLink(win, REMOTE_SRC + "/lib/underscode.min.js", function () {
						loadLink(win, REMOTE_SRC + "/lib/backbone.min.js", function () {
							loadLink(win, REMOTE_SRC + "/dev/base_dev.js", function () {
								loadLink(win, REMOTE_SRC + "/assets/js/deps.js", function () {
									loadLink(win, REMOTE_SRC + "/src/" + win.loader_path + "/loader.js", function () {
										async.eachSeries(SCRIPTS, function (src, callback) {
										loadScript(win, BASE_URL + src ,callback)
										});
									});
								});
							});
						});
					});
				});
			});
   		});
	}
}
//Promise写法
function hell(win){
	//  for listener purpose
	return async function(){
		await loadLink(win, REMOTE_SRC + "/assets/css/style.css");
		await loadLink(win, REMOTE_SRC + "/lib/async.js");
		await loadLink(win, REMOTE_SRC + "/lib/json2.js");
		await loadLink(win, REMOTE_SRC + "/lib/underscode.min.js");
		await loadLink(win, REMOTE_SRC + "/lib/backbone.min.js");
		await loadLink(win, REMOTE_SRC + "/dev/base_dev.js");
		await loadLink(win, REMOTE_SRC + "/assets/js/deps.js");
		await loadLink(win, REMOTE_SRC + "/src/" + win.loader_path + "/loader.js");
		await async.eachSeries(SCRIPTS);
		return await loadScript(win, BASE_URL + src )
	}
}
//Rx写法
function hell(win){
	//  for listener purpose
	return function(){
    return loadLink(win, REMOTE_SRC + "/assets/css/style.css")
    .flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/lib/async.js")
    }).flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/lib/json2.js")
    }).flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/lib/underscode.min.js");
    }).flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/lib/backbone.min.js");
    }).flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/dev/base_dev.js");
    }).flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/assets/js/deps.js");
    }).flatMap(() => {
      return loadLink(win, REMOTE_SRC + "/src/" + win.loader_path + "/loader.js");
    }).flatMap(() => {
      return async.eachSeries(SCRIPTS);
    }).flatMap(() => {
      return loadScript(win, BASE_URL + src )
    }).subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
	}
}

async function loadLink(win,R){
	return new Permise((resolve,reject) => {
		resolve(res)
	})
}